package com.mty.security.handler;

import com.mty.common.vo.Result;
import com.mty.security.exception.PermissionException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author ：Teacher马（2508531326@qq.com）
 * @date ：Created in 2022/12/2 17:12
 * @description：标记该类为全局异常处理类
 * @modified By：
 * @version:
 */
@RestControllerAdvice
public class MyGlobalHandler {
    @ExceptionHandler(value = PermissionException.class)
    public Result<String> permissionException(PermissionException p){
        return new Result<>(408,p.getMessage());
    }
}
